package com.tools.ad.ui.crad.view;

import android.content.Context;
import android.support.annotation.NonNull;

import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.hm.adsui.card.SmallNativeAdCardView;
import com.hm.base.android.ui.glide.RoundTransform;
import com.tools.ad.R;

/**
 * desc:
 * date: 2018/1/5
 * author: ancun
 */

public class CommonCardView extends SmallNativeAdCardView {

    public CommonCardView(@NonNull Context context) {
        super(context);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.ad_common_card_layout;
    }

    @Override
    protected BitmapTransformation getCoverBitmapTransform() {
        RoundTransform transform = new RoundTransform(mContext);
        transform.setTopLeftRound(false);
        transform.setTopRightRound(false);
        transform.setBottomLeftRound(false);
        transform.setBottomRightRound(false);

        return transform;
    }

    @Override
    protected BitmapTransformation getIconBitmapTransform() {
        return new CenterCrop(mContext);
    }
}
